﻿using UnityEngine;
using System.Collections;

public class Numbers : MonoBehaviour {

	private TextMesh t_Number;
	private BoxCollider sizeText;
	public int thisNumber;

	void Start () {
		t_Number = GetComponent<TextMesh>();
		sizeText = GetComponent<BoxCollider>();

		t_Number.color = GetColor.getColor ();

		t_Number.text = ""+InstanceThings.countNumbers;//seteo el numero q quiero mostrar

		thisNumber = InstanceThings.countNumbers;//lo guardo aca asi lo saco de otro lugar y se q numero es

		//si supera 9 vuelvo a contar, si no suma.
		if (InstanceThings.countNumbers >8)
			InstanceThings.countNumbers = 1;
		else
			InstanceThings.countNumbers++;
	}
	
	void Update () {
		t_Number.fontSize += 1;
		sizeText.size += new Vector3(0.0055f,0.008f,0);

		if (t_Number.fontSize > 250)
			this.enabled = false;
	}
}
